package com.kawaiior.asoulworld.capability;

import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.INBTSerializable;

public class MiyuPower implements INBTSerializable<NBTTagCompound> {

    private double posX;
    private double posY;
    private double posZ;
    private long move_time;
    private boolean back = false;

    public boolean isBack() {
        return back;
    }

    public void setBack(boolean back) {
        this.back = back;
    }

    public void setPos(double x, double y, double z){
        this.posX = x;
        this.posY = y;
        this.posZ = z;
    }

    public void setMoveTime(long move_time) {
        this.move_time = move_time;
    }

    public double getPosX() {
        return posX;
    }

    public double getPosY() {
        return posY;
    }

    public double getPosZ() {
        return posZ;
    }

    public long getMoveTime() {
        return move_time;
    }

    @Override
    public NBTTagCompound serializeNBT() {
        NBTTagCompound nbt = new NBTTagCompound();

        nbt.setLong("miyulongtime", move_time);
        nbt.setDouble("miyuposx", posX);
        nbt.setDouble("miyuposy", posY);
        nbt.setDouble("miyuposz", posZ);
        nbt.setBoolean("miyuback", back);

        return nbt;
    }

    @Override
    public void deserializeNBT(NBTTagCompound nbt) {
        this.setPos(nbt.getDouble("miyuposx"), nbt.getDouble("miyuposy"), nbt.getDouble("miyuposz"));
        this.setMoveTime(nbt.getLong("miyulongtime"));
        this.back = nbt.getBoolean("miyuback");
    }
}
